package com.ourway.dtos;

import com.ourway.entity.FeiShuDepartment;
import com.ourway.entity.FeiShuDepartmentSync;
import com.ourway.entity.FeiShuUser;
import com.ourway.entity.FeiShuUserSync;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 *
 *
 * @author liuweiheng
 * @since 2021/12/12
 */
@Data
@Accessors(chain = true)
@Builder
public class CheckDeptResultDTO implements Serializable {
    private Boolean success;

    private String message;

    private DepartmentDTO old;

    private FeiShuDepartmentSync feiShuDepartmentSync;

    private FeiShuDepartment feiShuDepartment;

    public final Boolean hasError = Boolean.TRUE.equals(success);

    public static CheckDeptResultDTO error(String message) {
        return CheckDeptResultDTO.builder().success(Boolean.FALSE).message(message).build();
    }

    public static CheckDeptResultDTO success(String message, DepartmentDTO old, FeiShuDepartmentSync feiShuDepartmentSync, FeiShuDepartment feiShuDepartment) {
        return CheckDeptResultDTO.builder().success(Boolean.TRUE).message(message).old(old).feiShuDepartmentSync(feiShuDepartmentSync).feiShuDepartment(feiShuDepartment).build();
    }
}
